#ifndef _BOARD_CONFIG_H_
#define _BOARD_CONFIG_H_

#include <driver/gpio.h>
#include <driver/uart.h>

#define AUDIO_INPUT_SAMPLE_RATE  16000
#define AUDIO_OUTPUT_SAMPLE_RATE 16000

#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_40
#define AUDIO_I2S_GPIO_WS GPIO_NUM_45
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_39
#define AUDIO_I2S_GPIO_DIN  GPIO_NUM_38
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_48

#define AUDIO_CODEC_PA_PIN       GPIO_NUM_46
#define AUDIO_CODEC_I2C_SDA_PIN  GPIO_NUM_21
#define AUDIO_CODEC_I2C_SCL_PIN  GPIO_NUM_47
#define AUDIO_CODEC_ES8311_ADDR  ES8311_CODEC_DEFAULT_ADDR

#define BUILTIN_LED_GPIO        GPIO_NUM_NC
#define BOOT_BUTTON_GPIO        GPIO_NUM_0
#define VOLUME_UP_BUTTON_GPIO   GPIO_NUM_NC
#define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC

#define I2C1_NUM                   GPIO_NUM_1
#define I2C1_SDA_PIN               GPIO_NUM_18
#define I2C1_SCL_PIN               GPIO_NUM_17



#define DISPLAY_WIDTH 280  
#define DISPLAY_HEIGHT 240
#define DISPLAY_SWAP_XY true   
#define DISPLAY_MIRROR_X true  
#define DISPLAY_MIRROR_Y false
#define BACKLIGHT_INVERT false
#define DISPLAY_OFFSET_X 20
#define DISPLAY_OFFSET_Y 0

#define DISPLAY_DC_GPIO     GPIO_NUM_12
#define DISPLAY_CS_GPIO     GPIO_NUM_11
#define DISPLAY_CLK_GPIO    GPIO_NUM_10
#define DISPLAY_MOSI_GPIO   GPIO_NUM_9
#define DISPLAY_RST_GPIO    GPIO_NUM_16

#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_14
#define DISPLAY_BACKLIGHT_OUTPUT_INVERT false


// #define DISPLAY_DC_GPIO     GPIO_NUM_5
// #define DISPLAY_CS_GPIO     GPIO_NUM_6
// #define DISPLAY_CLK_GPIO    GPIO_NUM_7
// #define DISPLAY_MOSI_GPIO   GPIO_NUM_15
// #define DISPLAY_RST_GPIO    GPIO_NUM_16

// #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_4
// #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false

#define BATTERY_ADC_CHANNEL ADC_CHANNEL_2
#define BATTERY_ADC_ATTEN ADC_ATTEN_DB_12
#define BATTERY_READ_INTERVAL_MS (10 * 1000) // 10 秒

#define BATTERY_ADC_PIN GPIO_NUM_3
#define CHARGING_GPIO GPIO_NUM_41
#define DONE_GPIO GPIO_NUM_42

// #define UART_ECHO_TXD GPIO_NUM_38
// #define UART_ECHO_RXD GPIO_NUM_48
// #define UART_ECHO_RTS (-1)
// #define UART_ECHO_CTS (-1)

// #define MOTOR_SPEED_MAX 100
// #define MOTOR_SPEED_80  80
// #define MOTOR_SPEED_60  60
// #define MOTOR_SPEED_MIN 0

// #define ECHO_UART_PORT_NUM      UART_NUM_1
// #define ECHO_UART_BAUD_RATE     (115200)
// #define BUF_SIZE                (1024)

// typedef enum {
//     LIGHT_MODE_CHARGING_BREATH = 0,
//     LIGHT_MODE_POWER_LOW,
//     LIGHT_MODE_ALWAYS_ON,
//     LIGHT_MODE_BLINK,
//     LIGHT_MODE_WHITE_BREATH_SLOW,
//     LIGHT_MODE_WHITE_BREATH_FAST,
//     LIGHT_MODE_FLOWING,
//     LIGHT_MODE_SHOW,
//     LIGHT_MODE_SLEEP,
//     LIGHT_MODE_MAX
// } light_mode_t;

#endif // _BOARD_CONFIG_H_
